/**
 * 
 */
package com.googlecode.bestpaper.utils;

import com.lowagie.text.Document;
import com.lowagie.text.Rectangle;

/**
 * @author xalinx at gmail dot com
 * @date Jan 27, 2010
 */
public class BestpaperUtils {
	private static String inputFileDirPath = "";

	public static String getInputFileDirPath() {
		return inputFileDirPath;
	}

	public static void setInputFileDirPath(String inputFileDirPath) {
		BestpaperUtils.inputFileDirPath = inputFileDirPath;
	}
	
	public static Document document;
	
	public static void setDocument(Document doc) {
		BestpaperUtils.document = doc;
	}
	
	private static float marginLeft;
	private static float marginRight;
	private static float marginTop;
	private static float marginBottom;
	
	public static void setMargin(float marginLeft,float marginRight,float marginTop,float marginBottom) {
		BestpaperUtils.marginLeft = marginLeft;
		BestpaperUtils.marginRight = marginRight;
		BestpaperUtils.marginTop = marginTop;
		BestpaperUtils.marginBottom = marginBottom;
	}
	
	public static float[] getDocumentSize() {
		Rectangle pageSize = document.getPageSize();
		float width = pageSize.getWidth() - marginLeft - marginRight;
		float height = pageSize.getHeight() - marginTop - marginBottom;
		return new float[]{width, height};
	}
	
	

}
